import service from "./request.js";

export default {
  // 修改标签条
  update(query) {
    return service({
      method: "PUT",
      url: "/admin-api/system/label/update",
      data: query,
    });
  },
  // 切换标签条状态
  status(query) {
    return service({
      method: "PUT",
      url: "/admin-api/system/label/reversal-status",
      data: query,
    });
  },
  // 核销标签条
  cancelStatus(query) {
    return service({
      method: "PUT",
      url: "/admin-api/system/label/cancel-status",
      data: query,
    });
  },
  // 打印标签条
  print(query) {
    return service({
      method: "POST",
      url: "/admin-api/system/label/print",
      data: query,
      responseType: "blob",
    });
  },
  // 创建标签条
  create(query) {
    return service({
      method: "POST",
      url: "/admin-api/system/label/create",
      data: query,
    });
  },
  // 创建标签条
  page(query) {
    return service({
      method: "POST",
      url: "/admin-api/system/label/page",
      data: query,
    });
  },
  // 获取标签条信息
  get(query) {
    return service({
      method: "GET",
      url: "/admin-api/system/label/get",
      params: query,
    });
  },
  // 打印标签条
  print(url, query) {
    return service({
      method: "POST",
      url: url,
      data: query,
      responseType: "blob",
    });
  },
  // 打印标签条记录分页
  printLog(query) {
    return service({
      method: "POST",
      url: "/admin-api/system/label-print/printLog",
      data: query,
    });
  },
  // 打印标签条明细记录分页
  printLogDetail(query) {
    return service({
      method: "POST",
      url: "/admin-api/system/label-print/printLogDetail",
      data: query,
    });
  },
  // 根据批次号打印标签条
  printByBatchno(query) {
    return service({
      method: "POST",
      url: "/admin-api/system/label-print/printByBatchno",
      data: query,
      responseType: "blob",
    });
  },
  // 标签条管理->打印记录新增导出按钮
  exportByBatchno(query) {
    return service({
      method: "POST",
      url: "/admin-api/system/label-print/exportByBatchno",
      data: query,
      responseType: "blob",
    });
  },
  // 标签条管理->打印明细
  printLogDetail(query) {
    return service({
      method: "POST",
      url: "/admin-api/system/label-print/printLogDetail",
      data: query,
    });
  },
  // 标签条管理->根据打印批次号获取标签条信息
  getLabelCodeByPrintBatchno(query) {
    return service({
      method: "GET",
      url: "/admin-api/system/label-print/getLabelCodeByPrintBatchno",
      params: query,
    });
  },
  // 标签条管理->打印签条信息txt
  // exportByBatchno(query) {
  //   return service({
  //     method: "POST",
  //     url: "/admin-api/system/label-print/exportByBatchno",
  //     params: query,
  //   });
  // },
  exportByBatchno: "/admin-api/system/label-print/exportByBatchno",
  // 仅支持单选点击确认后进行核销
  reversalStatus(query) {
    return service({
      method: "PUT",
      url: "/admin-api/system/label/reversal-status",
      data: query,
    });
  },
};
